<script>
	import store from '@/store/index.js'
	export default {
		onLaunch: function() {
			let info = uni.getSystemInfoSync(); // 获取手机系统信息
			store.commit('setSystem', info);
			this.globalData.windowHeight = info.windowHeight;
			// #ifdef MP-WEIXIN
			let menuButtonInfo = uni.getMenuButtonBoundingClientRect(); // 获取小程序胶囊的位置
			this.globalData.capsuleWidth = menuButtonInfo.width;
			this.globalData.winwidth = info.windowWidth; // 当前屏幕的宽度
			this.globalData.statusBarHeight = info.statusBarHeight; // 获取小程序头部状态栏的高度
			this.globalData.windowWidth = menuButtonInfo.left ? menuButtonInfo.left : `281px`; // 获取除了胶囊的宽度的剩余宽度
			this.globalData.navBarHeight = (menuButtonInfo.bottom - info.statusBarHeight) + (menuButtonInfo.top - info
				.statusBarHeight);
			
			// #endif
			let navInfo = {
				navHeight: this.globalData.navBarHeight?this.globalData.navBarHeight:40,
				totalHeight:this.globalData.navBarHeight+info.statusBarHeight,
				// #ifdef H5
				   navWidth: this.globalData.windowWidth?this.globalData.windowWidth:`100%`,
				   capsuleWidth:87
				// #endif
				// #ifdef MP-WEIXIN
				navWidth: this.globalData.windowWidth?`${this.globalData.windowWidth}px`:`281px`,
				capsuleWidth:menuButtonInfo.width?menuButtonInfo.width:0
				// #endif
			}
			store.commit('getNav', navInfo);
		},
		onShow: function() {
			
		},
		onHide: function() {
			
		},
		globalData: {
			color: '#ff6501',//#ed7083
			color_aid: '#ff8d44',
			statusBarHeight: 0,
			windowWidth: 0,
			navBarHeight: 40,
			winwidth: 375,
			windowHeight: 0,
			capsuleWidth: 0,
			bg_color:'#ffffff'
		}
	}
</script>

<style lang="scss">
	@import url('@/static/css/main.css');
	@import url('@/static/css/iconfont.css');
	@import "uview-ui/index.scss";
	.thmeColor{color: var(--color)!important;}
	.thmeBg{background: var(--color)!important;}
	.thmeBorder{border: 2upx solid var(--color)!important;}
	.thmeBorderBottom{border-bottom: 4upx solid var(--color)!important;}
	.btn3{
		width: 690rpx;
		height:80rpx;
		line-height: 80rpx;
		border: none;
		border-radius: 100px;
		margin: 0 auto;
		background: #ff4b4e;
		display: block;
		appearance: none;
		-webkit-appearance: none;
		font-size: 28rpx;
		font-family: "microsoft yahei";
		text-align: center;
		color: #ffffff;
	}
	.ViewBox{
		width:100%;
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
	}
</style>
